From 985a0a766bd1e8facbf49d3abf4b69bf82a623f9 Mon Sep 17 00:00:00 2001 From: Matthieu Gallien Date: Wed, 7 May 2025 14:37:43 +0200 Subject: [PATCH] fix(readonly): enable MOVE rollback when folder is read-only Signed-off-by: Matthieu Gallien --- src/libsync/propagateremotemove.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libsync/propagateremotemove.cpp b/src/libsync/propagateremotemove.cpp index 34c172bd3..63078c697 100644 --- a/src/libsync/propagateremotemove.cpp +++ b/src/libsync/propagateremotemove.cpp @@ -209,7 +209,9 @@ void PropagateRemoteMove::slotMoveJobFinished() &propagator()->_anotherSyncNeeded); const auto filePath = propagator()->fullLocalPath(_item->_renameTarget); const auto filePathOriginal = propagator()->fullLocalPath(_item->_originalFile); + const auto oldFile = QFileInfo{filePathOriginal}; QFile file(filePath); + auto permissionsHandler = FileSystem::FilePermissionsRestore{oldFile.absolutePath(), FileSystem::FolderPermissions::ReadWrite}; if (!file.rename(filePathOriginal)) { qCWarning(lcPropagateRemoteMove) << "Could not MOVE file" << filePathOriginal << " to" << filePath << " with error:" << _job->errorString() << " and failed to restore it !"; -- 2.30.2